home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / p2c / p2c 1.21a2.1 / p2c 1.21a2.1.rsrc / TEXT_137_Coding Options.txt < prev    next >
Encoding:
Text File  |  1994-11-22  |  11.9 KB  |  358 lines

  1. # CODING OPTIONS
  2.  
  3. InitialCalls    # Initial function calls (or other brief C
  4. InitialCalls    # statements) to put at front of main program.
  5. InitialCalls    # E.g.: InitialCalls setup_buffer()
  6.  
  7. ExpandIncludes    # 1 or default=expand include files into output
  8.     # 0=convert Pascal include to #include
  9.  
  10. CollectNest # 1 or default=collect sub-procs, emit at end.
  11.     # 0=emit sub-procedures one by one; this will
  12.     #    produce bad code but is useful with
  13.     #    ExpandIncludes=0.
  14.  
  15. ShortCircuit    # 1=use &&, 0=use & for boolean AND, also OR.
  16.     # default=1 for Turbo/HP-UX, 0 for HP Pascal
  17.     #    may be overridden by {$B} / $partial_eval$
  18.  
  19. ShortOpt    # 1 or default=optimize a&b to a&&b if equiv
  20.     # 0=always use a&b, depending on ShortCircuit
  21.  
  22. ElimDeadCode    # 1 or default=eliminate unreachable code
  23.     # 2=even eliminate "if (false)" statements
  24.     # 0=leave unreachable code in place
  25.  
  26. AnalyzeFlow            # 1 or default=perform data flow analysis
  27.                 # 0=make no assumptions based on data flow
  28.  
  29. FoldConstants    # 1=instantiate non-structure const's in-line
  30.     #    (applies to int, char, boolean, enum, real)
  31.     # 0 or default=use #define's for constants
  32.     # 0 causes constant to be completely symbolic;
  33.     # default sometimes instantiates if convenient.
  34.     # A constant is folded if FoldConstants=1
  35.     # either when the const was defined, or when
  36.     # it was referenced.
  37.  
  38. FoldStrConstants    # 1=instantiate string const's in-line, as above
  39.     # 0 or default=use #define's for string const's
  40.  
  41. CharConsts    # 1 or default=const a='X' => #define a 'X'
  42.     # 0=const a='X' => #define a "X"
  43.     # (either always works---aesthetic only)
  44.  
  45. UseConsts    # 1=use "const" keyword in C
  46.     # 2=use "Const" form even if UseAnyptrMacros=0
  47.     # 0=do not use "const" declarations
  48.     # default=1 if AnsiC=1 or C++=1
  49.  
  50. UseUndef    # 1=use "#undef" when #defines go out of scope
  51.     # 0=do not use "#undef", default=1.
  52.  
  53. UseInits                        # 1=use "int x = 5" instead of "int x; x = 5"
  54.                                 # 2=use "int x = a" for non-constant "a"
  55.                                 # 3=use inits throughout body, a la C++
  56.                                 # 4=use multiple inits in "if" branches, etc.
  57.                                 # 0=do not convert assignments to initializers
  58.                                 # default=4 if C++=1, 1 otherwise
  59.  
  60. StoreFileNames    # 1=store file names associated with file vars
  61.     # 0=let the system record the name
  62.     # default=1 in Turbo Pascal, 0 otherwise.
  63.  
  64. SqueezeSubr # 1 or default=squeeze subranges into char, etc.
  65.     # 0=use only short's and int's (or long's).
  66.  
  67. UseEnum # 1=use C "enum" types
  68.     # 0=use integers for enumerations
  69.     # default=1 unless AnsiC=0
  70.  
  71. SqueezeEnum # 1=use bytes for small enums, when UseEnum=0
  72.     # 0=use shorts always
  73.     # default=0 for HP Pascal, 1 otherwise.
  74.  
  75. CompEnums    # 1=okay to compare enums directly
  76.     # 0=cast enums to ints for comparisons
  77.     # default=0 unless AnsiC=1.
  78.  
  79. PreserveTypes    # 1 or default=use typedef for all Pascal types
  80.     # 0=don't unnecessarily use typedef
  81.     # (Can be turned on/off for different decls)
  82.  
  83. PreservePointers    # 1=override PreserveTypes for pointer types
  84.     # 0 or default=use in-line "*" notation
  85.     # -1=same as PreserveTypes
  86.  
  87. PreserveStrings # 1=override PreserveTypes for string types
  88.     # 2=use typedef for strings w/non-const lengths
  89.     # 0=use in-line "[]" notation for strings
  90.     # -1 or default=same as PreserveTypes
  91.  
  92. Packing # 1 or default=fully packed records and arrays
  93.     # 0=ignore "packed" keyword
  94.     # 2=pack to bytes, but not bits
  95.  
  96. PackSigned    # 1=implement packed arrays of signed values
  97.     # 0=only pack unsigned arrays
  98.     # default=1
  99.  
  100. SkipIndices # Number of vacant array indices allowable,
  101.     # default 0.    If 1, then array [1..10] is
  102.     # converted to array [11], but array [2..10]
  103.     # would be converted as array [9] with offsets.
  104.  
  105. OffsetForLoops    # 1=adjust loops where index is always used
  106.     #    as, e.g., i-1 by offsetting the index.
  107.     # 0=leave them alone.    Default=1.
  108.  
  109. ForEvalOrder    # 1=in for x:=y to z, force eval of y before z.
  110.     # 0 or default=evaluation order unimportant.
  111.  
  112. StringLeaders    # Number of leading '>' placeholder characters
  113.     # that can be prepended to a string literal.
  114.     # Default is 3.
  115.  
  116. StringCeiling    # Maximum size for strings. Default is 255.
  117.     # If > 255, allows some "slop" in strings.
  118.     # If < 255, shortens large strings.
  119.  
  120. StringDefault    # Size of string declared without [ ] brackets.
  121.     # Default is 255.
  122.  
  123. StringTruncLimit    # Minimum size of strings for which a warning
  124.     # is generated when assigned possibly longer
  125.     # strings.    These are assignments to check if
  126.     # Turbo-like truncation is necessary.
  127.     # Default is 80 for Turbo, 0 otherwise.
  128.  
  129. LongStringSize    # Smallest string which can be considered
  130.     # "arbitrarily long"; default=StringCeiling.
  131.  
  132. KeepNulls    # 1=try to preserve null (#0) chars in strings
  133.     # 0 or default=ignore them (but warn)
  134.  
  135. HighCharBits    # 1=convert "ch >= 128" to "(ch & ~127) != 0"
  136.     # 2=convert "ch >= 128" to "(ch & 128) != 0"
  137.     # 0=do not use bit ops for high characters
  138.     # default=1 only if ch's signed-ness is unknown
  139.  
  140. StaticFunctions # 1 or default=use "static" for private funcs
  141.     # 0=don't create static functions
  142.  
  143. StaticVariables # 1 or default=use "static" for private vars
  144.     # 0=don't create static global vars
  145.  
  146. NeedStatic                      # Names of functions or variables which
  147. NeedStatic                      # need to be declared static despite
  148. NeedStatic                      # StaticFunctions=0 or StaticVariables=0.
  149.  
  150. AlwaysCopyValues    # 1=always make a local copy of a parameter
  151.     # 0 or default=only if it appears to be changed
  152.  
  153. VoidArgs    # 1=write "f(void)" for funcs with no args
  154.     # 0=write "f()" for funcs with no args
  155.     # default=depends on AnsiC and C++
  156.  
  157. Prototypes    # 1=write "f(int a, int b)"
  158.     # 2=write "f(int, int)" when possible
  159.     # 0=write "f(a, b) \n int a, b;"
  160.     # default=depends of AnsiC and C++
  161.  
  162. FullPrototyping # 1 or default=use prototypes everywhere
  163.     # 0=use prototypes only for forward/extern
  164.  
  165. ProcPtrPrototypes    # 1 or default=use prototypes for C func ptrs
  166.     # 0=always write, e.g., int (*fp)();
  167.  
  168. CastArgs    # 1=include argument casts if needed: (double)i
  169.     # 0=do not include argument casts (dangerous!)
  170.     # default=do not cast if func has a prototype
  171.  
  172. CastLongArgs    # 1=include int/long argument casts if needed
  173.     # 0=do not cast between int and long
  174.     # default=follow CastArgs
  175.  
  176. PromoteArgs # 1=promote e.g. short to int in prototypes
  177.     # 0=do not promote in prototypes
  178.     # default=only when prototyping forwards only
  179.  
  180. FixPromotedArgs # 1=attempt to handle "&" of promoted args
  181.     # 2=warn in this case but do not try to fix
  182.     # 0=leave promoted args alone
  183.     # default=1
  184.  
  185. PromoteEnums    # 1=promote enum to int when promoting args
  186.     # 0=leave enums alone in prototypes
  187.     # default=only when UseEnum=0
  188.  
  189. StaticLinks # 1=use _PROCEDURE (ProcTypeName) for proc ptrs
  190.     # 2=use _PROCEDURE but assume only global procs
  191.     # 0=use C function pointers, no static links
  192.     # default=1 in HP, 0 in Turbo Pascal
  193.  
  194. VarStrings    # 1=full support for "var s:string" params
  195.     #    and HP Pascal's strmax function
  196.     # 0=assume all var s:string's are string[255]
  197.     # default=0 always; may need 1 for some
  198.     #    HP Pascal programs
  199.  
  200. VarFiles    # 1 or default="var f : file" params use &
  201.     # 0=pass FILE *'s by value; must not open or
  202.     #    close the file within the procedure
  203.  
  204. UseRefs                         # 1=use C++ "int &x = y" when appropriate.
  205.                                 # 0=use C "int *x = &y".
  206.                                 # default=1 if C++=1, 0 otherwise
  207.  
  208. AddrStdFiles    # 1=okay to write "&stdout", etc.
  209.     # 0 or default=not okay
  210.  
  211. CopyStructFuncs # 1=write "temp = f(); temp.field"
  212.     # 0=write "f().field"
  213.     # default=1 unless AnsiC=1
  214.  
  215. Atan2    # 1=convert arctan(a/b) to atan2(a,b)
  216.     # 0 or default=convert it to atan(a/b)
  217.  
  218. BitwiseMod    # 1 or default=convert x mod 16 to x&15
  219.     # 0=convert x mod 16 to x%16
  220.  
  221. BitwiseDiv    # 1=convert x div 16 to x>>4
  222.     # 0 or default=convert x div 16 to x/16
  223.  
  224. AssumeBits    # 1=assume args of funcs like na_po2 are
  225.     #    within reasonable range; write 1<<x.
  226.     # 0 or default=no assumptions; write na_po2
  227.  
  228. AssumeSigns # 1 or default=for e.g. na_lsl, assume
  229.     #    "x" is positive, "-x" is negative.
  230.     # 0=no assumptions (except for constants!)
  231.  
  232. NewDelete            # 1=use C++ "new" and "delete"
  233.                 # 0=use C "malloc" and "free"
  234.                 # default=1 if C++=1, 0 otherwise
  235.  
  236. AllocZeroNil    # 1=na_new(p,0) must set p to nil
  237.     # 0 or default=not necessary
  238.     # 2=not necessary, but print a warning
  239.  
  240. PrintfOnly    # 1=don't use puts, putc, etc., in WRITE
  241.     # 0=use puts, etc., as well as printf
  242.     # default=a pleasing compromise
  243.  
  244. MixWritelns # 1 or default=writeln;writeln=>printf("\n\n")
  245.     # 0=don't mix consecutive writeln stmts
  246.  
  247. MessageStderr            # 1 or default="message" writes to stderr
  248.                 # 0="message" is exactly like "writeln"
  249.  
  250. IntegerWidth    # Default field width for writing integers.
  251.     # Default is 1 for Turbo, 12 for HP.
  252.  
  253. RealWidth    # Default field width for writing reals.
  254.     # Default is 12.
  255.  
  256. FormatStrings    # 1=full support for write(string:width)
  257.     # 0 or default=':width' only stretches
  258.  
  259. WhileFgets    # 1 or default=while (fgets(...)) { ... }
  260.     # 0=while (!eof(...)) { fgets(...); ... }
  261.  
  262. UseGets # 1 or default=use gets to read string[255]
  263.     # 0=always use fgets (with length checking)
  264.  
  265. FloatScanfCode                  # Name of scanf control string for floats.
  266.                                 # Default is "%g".
  267.  
  268. NewLineSpace    # 1=convert \n to ' ' in read(ch)
  269.     # 0=leave newlines alone reading characters
  270.     # default=0 in Turbo Pascal, 1 otherwise
  271.  
  272. BuildReads    # 1=combine x:=f^;get(f) into read(f,x)
  273.     # 2=only for text files and files of char
  274.     # 0=leave it alone; default=1
  275.  
  276. BuildWrites # 1=combine f^:=x;put(f) into write(f,x)
  277.     # 2=only for text files and files of char
  278.     # 0=leave it alone; default=1
  279.  
  280. BinaryMode    # 1 or default=fopen binary files as, say, "rb"
  281.     # 0=fopen binary files as "r"
  282.     # 2=fopen binary files as "r" with a warning
  283.  
  284. ReadWriteOpen    # 1=RESET/REWRITE open binary files read/write
  285.     # 0=RESET opens read-only, REWRITE write-only
  286.     # 2=Open all files (text and binary) read/write
  287.     # default=1 in Turbo, 0 otherwise.
  288.  
  289. OpenMode    # fopen mode string to use for Pascal open
  290.     # statement.    Use a+ if that mode allows
  291.     # seeking.    Default=build out of ANSI modes
  292.  
  293. FileNameFilter    # Name of a function to call which converts
  294.     # a file name into a form usable by fopen;
  295.     # if name must be changed this should return
  296.     # a pointer to a static buffer.
  297.     # Not used for constant names.    "0"=no filter.
  298.     # default=P_trimname for Oregon/Berk, else 0
  299.  
  300. LiteralFiles    # 0=nameless rewrite(f) generates a temp file
  301.     # 1=nameless rewrite(f) uses "f" as file name
  302.     # 2=like 1 only if f appeared in "program" stmt
  303.     # default=2 for Berkeley, else 0.
  304.  
  305. LiteralFile # A file variable which should be treated as
  306. LiteralFile # if LiteralFiles=1.    If LiteralFiles=2, files
  307. LiteralFile # in program header are added to this list.
  308.  
  309. StructFiles # 1="file of x" produces a struct with buffer
  310.     #    and file-name included.
  311.     # 0 or default=use native FILE *'s, with
  312.     #    extra variables to hold buffer and name.
  313.  
  314. StructFile    # A file variable which should be treated as
  315. StructFile    # if StructFiles=1.
  316.  
  317. FullStrWrite    # 1=full implementation of strwrite(s,i,j,...)
  318.     # 0=ignore "j" variable and other issues
  319.     # default=assign "j", assume not mid-string
  320.     # 2=like default, but issue a warning
  321.  
  322. FullStrRead # 1 or default=full impl of strread using "%n"
  323.     # 0=fake the value of "j"
  324.     # 2=like default, but issue a warning
  325.  
  326. SetBits # Number of bits to use in each "long" of a set
  327.     # default=LongSize if defined, else 32
  328.  
  329. DefaultSetSize    # Default size of un-typed set constants;
  330.     # default default=256 for VAX, else 8192
  331.  
  332. SmallSetConst    # 0=write small-set literals like "1<<2|1<<4"
  333.     # 1=write them like "0x14"
  334.     # 2=write them like "20"
  335.     # -1=do not use small-sets at all
  336.     # default=-1 if SetBitsName defined, else 1
  337.  
  338. BigSetConst # (analogous to SmallSetConst for big sets)
  339.  
  340. LeLeRange    # 1=write "j in [1..10]" as "1<=j && j<=10"
  341.     # 0 or default=write ... as "j>=1 && j<=10"
  342.  
  343. UnsignedTrick    # 1 or default=write "(unsigned)i <= 10"
  344.     # 0=leave "i >= 0 && i <= 10" alone
  345.  
  346. UseIsAlpha    # 1 or default=use "isalpha", "isdigit", etc.
  347.     # 0=use plain comparisons
  348.  
  349. UseIsSpace    # 1=convert "c==' '" to "isspace(c)"
  350.     # 0 or default=leave it alone
  351.  
  352. UseStrncmp    # 1=use strncmp to compare packed array of char
  353.     # 0=use memcmp, same as for all other arrays
  354.     # default=1
  355.  
  356.  
  357.  
  358.